// import cloneDeep from "lodash/cloneDeep";
export default {
	props: {
		formData: {
			type: Object,
			default () {
				return {};
			},
		},
		item: {
			type: Object,
			default () {
				return {};
			},
		},
	},
	computed: {
		bindOptions() {
			const obj = JSON.parse(JSON.stringify(this.item))
			if (obj.fieldType !== "HrCell") {
				delete obj.value;
			}
			delete obj.fieldType;
			return obj;
		},
	},
	watch: {
		item: {
			handler(val) {
				this.$set(this.formData, val.name, val.value);
			},
			immediate: true,
			deep: true,
		},
	},
	methods: {
		handleClick(item) {
			this.$emit("handle-click", item);
		},
		handleClickIcon(item) {
			this.$emit("handle-click-icon", item);
		},
	},
};